package com.attendance.pojo;

import com.attendance.base.BaseEntity;
import com.attendance.security.user.pojo.AbstractUserDetails;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 用户详细信息
 *
 * @author 鵺丶
 * @date 2021/03/13
 */
@ToString(callSuper = true)
@Data
@EqualsAndHashCode(callSuper = true)
@Component
@TableName("t_user_details")
public class UserDetails extends BaseEntity implements AbstractUserDetails {
    @TableId(type = IdType.INPUT)
    private Long uId;
    private String name;
    private String sex;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date dateBirth;
    private String tel;
    @TableField(exist = false)
    private String roleNames;
    @TableField(exist = false)
    private String departName;
}
